package com.tools.bitbucket.pojo;

import lombok.Data;

import java.util.Objects;

@Data
/**
 * 仓库信息
 */
public class CloneObject {
    //仓库克隆地址
    private String href;
    //仓库克隆类型 ssh http
    private String name;
    //是否备份过
    private Boolean exist;
    //是否有变化，通过 git rev-parse HEAD 获取最新的commitId 与 历史commitId 比较，不同则存在变化
    private Boolean change;
    //最新的commitId
    private String latestCommitId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CloneObject that = (CloneObject) o;
        return Objects.equals(href, that.href) &&
                Objects.equals(name, that.name) ;
    }

    @Override
    public int hashCode() {
        return Objects.hash(href, name);
    }
}
